
# count = 0
# while True:
#     f = open('C:/Users/86158/Downloads/Python/test.txt', 'r')
#     count = count + 1
#     print(f'打开的无间隔数：{count}')

# print(f)
# print(type(f))

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'w')
# f.write('world')
# f.close()

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'w')
# f.close()
# f.write('hello')


# f = open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='gbk')
# ret = f.read(2)
# print(ret)
# f.close()

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='utf8')
# ret = f.read(2)
# print(ret)
# f.close()

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='utf8')
# for line in f:
#     print(line)
# f.close()

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='utf8')
# for line in f:
#     print(line, end='')
# f.close()

# f = open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='utf8')
# ret = f.readlines()
# print(ret)
# f.close()


def Func():
    with open('C:/Users/86158/Downloads/Python/test.txt', 'r', encoding='utf8') as f:
        if True:
            return
        f.close()


